In ThreadRoutine() // run when
created
l
lwhile(true)
l lock (threadPool)
l if this is a new started thread
l while (request queue is empty)
l Monitor.Wait(threadPool, …);
//unlock and wait
l get a request from queue
l serviceAgentRequest.State = init
l else
l this is a resuming thread after
suspend
l
l Execute Service Agent